<template>
  <view class="u-content">
    <u-parse :html="content"></u-parse>
  </view>
</template>

<script>
export default {
  data() {
    return {
      content: ''
    }
  },
  onLoad(options) {
    this.key = options.key
    this.getPolicy()
  },
  methods: {
    getPolicy() {
      this.$api.getConfigByKey(this.key).then(res => {
        this.content = res.value
        // 设置标题
        uni.setNavigationBarTitle({
          title: res.title
        })
      })
    }
  }
}
</script>

<style>
page {
  height: 100%;
  overflow: hidden;
}
.u-content {
  height: 100%;
  padding: 20rpx;
  overflow: auto;
}
</style>
